<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:loc="clr-namespace:ResourceBlender_Express">
  
  <!-- Button -->
  <!-- Focus Visual -->
  <Style x:Key="ButtonFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Border>
            <Rectangle 
              Margin="2"
              StrokeThickness="1"
              Stroke="#60000000"
              StrokeDashArray="1 2"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- SimpleStyles: Button -->
  <Style TargetType="Button">
    <Setter Property="Margin" Value="2" />
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
    <Setter Property="MinHeight" Value="10"/>
    <Setter Property="MinWidth" Value="10"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Button">
          <Border 
            x:Name="Border"  
            CornerRadius="1" 
            BorderThickness="1"
            Background="{StaticResource NormalBrush}"
            BorderBrush="{StaticResource NormalBorderBrush}">
            <ContentPresenter 
              Margin="2"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              RecognizesAccessKey="True"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsDefaulted" Value="true">
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
    <!-- Toolbar Button -->
    <Style TargetType="{x:Type Image}" x:Key="ToolBarButtonImageStyle">
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.5" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style TargetType="{x:Type loc:ToolBarButton}">
        <Setter Property="Margin" Value="4,2" />
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type loc:ToolBarButton}">
                <Border x:Name="Border"
                        CornerRadius="1" 
                        BorderThickness="1"
                        Padding="3">
                        <StackPanel>
                            <Image x:Name="img" Source="{TemplateBinding Image}" Style="{StaticResource ToolBarButtonImageStyle}" IsEnabled="{TemplateBinding IsEnabled}" />
                            <TextBlock Text="{TemplateBinding Text}" IsEnabled="{TemplateBinding IsEnabled}" Margin="0,2,0,0" />
                        </StackPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="Gray" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                          <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                          <Setter TargetName="Border" Property="Background" Value="{StaticResource NormalBrush}" />
                          <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource NormalBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                          <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                          <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                          <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                          <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                          <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
  <!-- Slider -->
  <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="IsTabStop" Value="false"/>
    <Setter Property="Focusable" Value="false"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Height" Value="14"/>
    <Setter Property="Width" Value="14"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Ellipse 
            Name="Ellipse" 
            Fill="{StaticResource NormalBrush}"
            Stroke="{StaticResource NormalBorderBrush}"
            StrokeThickness="1" />
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource DarkBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="HorizontalSlider" TargetType="{x:Type Slider}">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto" MinHeight="{TemplateBinding Slider.MinHeight}"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <TickBar 
        Name="TopTick"
        SnapsToDevicePixels="True" 
        Placement="Top"
        Fill="{StaticResource GlyphBrush}"
        Height="4"
        Visibility="Collapsed" />
      <Border 
        Name="TrackBackground"
        Margin="0"
        CornerRadius="2" 
        Height="4"
        Grid.Row="1"
        Background="{StaticResource LightBrush}" 
        BorderBrush="{StaticResource NormalBorderBrush}"
        BorderThickness="1" />
      <Track Grid.Row="1" Name="PART_Track">
        <Track.DecreaseRepeatButton>
          <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.DecreaseLarge" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource SliderThumbStyle}" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.IncreaseLarge" />
        </Track.IncreaseRepeatButton>
      </Track>
      <TickBar 
        Name="BottomTick"
        SnapsToDevicePixels="True" 
        Grid.Row="2"
        Fill="{TemplateBinding Foreground}"
        Placement="Bottom"
        Height="4"
        Visibility="Collapsed" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="TickPlacement" Value="TopLeft">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="TickPlacement" Value="BottomRight">
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="TickPlacement" Value="Both">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <ControlTemplate x:Key="VerticalSlider" TargetType="{x:Type Slider}">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto" MinWidth="{TemplateBinding Slider.MinWidth}"/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <TickBar 
        Name="TopTick"
        SnapsToDevicePixels="True" 
        Placement="Left"
        Fill="{StaticResource GlyphBrush}"
        Width="4"
        Visibility="Collapsed" />
      <Border 
        Name="TrackBackground"
        Margin="0"
        CornerRadius="2" 
        Width="4"
        Grid.Column="1"
        Background="{StaticResource HorizontalLightBrush}" 
        BorderBrush="{StaticResource HorizontalNormalBorderBrush}"
        BorderThickness="1" />
      <Track Grid.Column="1" Name="PART_Track">
        <Track.DecreaseRepeatButton>
          <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.DecreaseLarge" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource SliderThumbStyle}" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.IncreaseLarge" />
        </Track.IncreaseRepeatButton>
      </Track>
      <TickBar 
        Name="BottomTick"
        SnapsToDevicePixels="True" 
        Grid.Column="2"
        Fill="{TemplateBinding Foreground}"
        Placement="Right"
        Width="4"
        Visibility="Collapsed" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="TickPlacement" Value="TopLeft">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="TickPlacement" Value="BottomRight">
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="TickPlacement" Value="Both">
        <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
        <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style TargetType="{x:Type Slider}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="MinWidth" Value="104" />
        <Setter Property="MinHeight" Value="21" />
        <Setter Property="Template" Value="{StaticResource HorizontalSlider}" />
      </Trigger>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="MinWidth" Value="21" />
        <Setter Property="MinHeight" Value="104" />
        <Setter Property="Template" Value="{StaticResource VerticalSlider}" />
      </Trigger>
    </Style.Triggers>
  </Style>
    <!-- StatusBar -->
   <Style x:Key="{x:Type StatusBar}" TargetType="{x:Type StatusBar}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type StatusBar}">
          <Border Background="{StaticResource LightBrush}"
            BorderBrush="{StaticResource NormalBorderBrush}"
            Padding="1">
            <ItemsPresenter/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Static StatusBar.SeparatorStyleKey}" TargetType="{x:Type Separator}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Separator}">
          <Rectangle Fill="{StaticResource LightBorderBrush}"
            Width="1"
            Margin="3"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type StatusBarItem}" TargetType="{x:Type StatusBarItem}">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type StatusBarItem}">
          <ContentPresenter Margin="3"/>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
    <!-- TabControl -->
  <Style  TargetType="{x:Type TabControl}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="SnapsToDevicePixels" Value="false" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource SolidBorderBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabControl}">
          <Grid KeyboardNavigation.TabNavigation="Local">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TabPanel 
              Name="HeaderPanel"
              Grid.Row="0"
              Panel.ZIndex="1" 
              Margin="0,0,4,-1" 
              IsItemsHost="True"
              KeyboardNavigation.TabIndex="1"
              Background="Transparent" />
            <Border 
              Name="Border" 
              Grid.Row="1" 
              Background="{TemplateBinding Background}" 
              BorderBrush="{TemplateBinding BorderBrush}" 
              BorderThickness="{TemplateBinding BorderThickness}" 
              CornerRadius="1" 
              KeyboardNavigation.TabNavigation="Local"
              KeyboardNavigation.DirectionalNavigation="Contained"
              KeyboardNavigation.TabIndex="2" >
              <ContentPresenter 
                Name="PART_SelectedContentHost"
                Margin="2,5,2,5"
                ContentSource="SelectedContent" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- TabItem -->
  <Style TargetType="{x:Type TabItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabItem}">
          <Grid>
            <Border 
              Name="Border"
              Margin="0,0,-4,0" 
              Background="{StaticResource LightBrush}"
              BorderBrush="{StaticResource SolidBorderBrush}" 
              BorderThickness="1,1,1,1" 
              CornerRadius="1,1,0,0" >
              <ContentPresenter x:Name="ContentSite"
                VerticalAlignment="Center"
                HorizontalAlignment="Center"
                ContentSource="Header"
                Margin="12,2,12,2"
                RecognizesAccessKey="True"/>
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Panel.ZIndex" Value="100" />
              <Setter TargetName="Border" Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- Label -->
  <Style x:Key="{x:Type Label}" TargetType="Label">
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Top"/>
    <Setter Property="Margin" Value="0,2,8,1" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Label">
          <Border Background="{TemplateBinding Background}">
            <ContentPresenter 
              Margin="{TemplateBinding Padding}"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
              RecognizesAccessKey="True"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground"
                      Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
    <!-- ListBox -->
  <Style x:Key="{x:Type ListBox}" TargetType="ListBox">
    <Setter Property="Margin" Value="2" />
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
    <Setter Property="OverridesDefaultStyle" Value="false"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    <Setter Property="MinWidth" Value="120"/>
    <Setter Property="MinHeight" Value="95"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBox">
          <Border 
            Name="Border" 
            Background="{TemplateBinding Background}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            CornerRadius="2">
            <ScrollViewer 
              Margin="0"
              Focusable="false">
              <StackPanel Margin="2" IsItemsHost="True" />
            </ScrollViewer>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="Border" Property="Background"
                      Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush"
                      Value="{StaticResource DisabledBorderBrush}" />
            </Trigger>
            <Trigger Property="IsGrouping" Value="true">
              <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- ListBoxItem -->
  <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border 
            Name="Border"
            Padding="2"
            SnapsToDevicePixels="true">
            <ContentPresenter />
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="true">
              <Setter TargetName="Border" Property="Background"
                      Value="{StaticResource SelectedBackgroundBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground"
                      Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- Radiobutton List -->    
  <Style x:Key="ApplicationRadioListTemplate" TargetType="ListBox" BasedOn="{StaticResource {x:Type ListBox}}">
      <Setter Property="Background" Value="Transparent" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="ItemContainerStyle">
          <Setter.Value>
              <Style TargetType="{x:Type ListBoxItem}">
                  <Setter Property="Margin" Value="2" />
                  <Setter Property="Template">
                      <Setter.Value>
                          <ControlTemplate TargetType="{x:Type ListBoxItem}">
                              <RadioButton IsChecked="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsSelected}">
                                  <ContentPresenter />
                              </RadioButton>
                          </ControlTemplate>
                      </Setter.Value>
                  </Setter>
              </Style>
          </Setter.Value>
      </Setter>
  </Style>
  
  <Style x:Key="RadioListTemplate" TargetType="ListBox" BasedOn="{StaticResource {x:Type ListBox}}">
      <Setter Property="Background" Value="Transparent" />
      <Setter Property="BorderThickness" Value="0" />
      <Setter Property="OverridesDefaultStyle" Value="true"/>
      <Setter Property="ItemContainerStyle">
          <Setter.Value>
              <Style TargetType="{x:Type ListBoxItem}">
                  <Setter Property="Margin" Value="2" />
                  <Setter Property="Template">
                      <Setter.Value>
                          <ControlTemplate TargetType="{x:Type ListBoxItem}">
                              <RadioButton IsChecked="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsSelected}">
                                  <ContentPresenter />
                              </RadioButton>
                          </ControlTemplate>
                      </Setter.Value>
                  </Setter>
              </Style>
          </Setter.Value>
      </Setter>
  </Style>
  
  <!-- GridView -->
  <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
    <Setter Property="Width" Value="18"/>
    <Setter Property="Background" Value="{StaticResource NormalBorderBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border Padding="{TemplateBinding Padding}"
            Background="Transparent">
            <Rectangle HorizontalAlignment="Center"
              Width="1"
              Fill="{TemplateBinding Background}"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type GridViewColumnHeader}"
         TargetType="GridViewColumnHeader">
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Foreground"
            Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="GridViewColumnHeader">
          <Grid>
            <Border Name="HeaderBorder"
              BorderThickness="0,0,0,1"
              BorderBrush="{StaticResource NormalBorderBrush}"
              Background="{StaticResource LightBrush}"
              Padding="5,4,5,4">
              <ContentPresenter Name="HeaderContent"
                Margin="0,0,0,1"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                RecognizesAccessKey="True"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
            </Border>
            <Thumb x:Name="PART_HeaderGripper"
              HorizontalAlignment="Right"
              Margin="0,0,-9,0"
              Style="{StaticResource GridViewColumnHeaderGripper}"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter TargetName="HeaderBorder"
                      Property="Background" Value="{StaticResource NormalBrush}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="HeaderBorder"
                      Property="Background" Value="{StaticResource PressedBrush}"/>
              <Setter TargetName="HeaderContent"
                      Property="Margin" Value="1,1,0,0"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground"
                      Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Role" Value="Floating">
        <Setter Property="Opacity" Value="0.7"/>
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="GridViewColumnHeader">
              <Canvas Name="PART_FloatingHeaderCanvas">
                <Rectangle Fill="#60000000"
                  Width="{TemplateBinding ActualWidth}"
                  Height="{TemplateBinding ActualHeight}"/>
              </Canvas>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Role" Value="Padding">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="GridViewColumnHeader">
              <Border Name="HeaderBorder"
                BorderThickness="0,1,0,1"
                BorderBrush="{StaticResource NormalBorderBrush}"
                Background="{StaticResource LightBrush}"/>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
    </Style.Triggers>
  </Style>

<!-- GridView Scollviewer -->    
  <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}"
         TargetType="ScrollViewer">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ScrollViewer">
          <Grid Background="{TemplateBinding Background}">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="*"/>
              <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <DockPanel Margin="{TemplateBinding Padding}">
              <ScrollViewer DockPanel.Dock="Top"
                HorizontalScrollBarVisibility="Hidden"
                VerticalScrollBarVisibility="Hidden"
                Focusable="false">
                <GridViewHeaderRowPresenter
                  Columns="{Binding Path=TemplatedParent.View.Columns,
                            RelativeSource={RelativeSource TemplatedParent}}"
                  ColumnHeaderContainerStyle="{Binding
                               Path=TemplatedParent.View.ColumnHeaderContainerStyle,
                               RelativeSource={RelativeSource TemplatedParent}}"
                  ColumnHeaderTemplate="{Binding
                               Path=TemplatedParent.View.ColumnHeaderTemplate,
                               RelativeSource={RelativeSource TemplatedParent}}"
                  ColumnHeaderTemplateSelector="{Binding 
                               Path=TemplatedParent.View.ColumnHeaderTemplateSelector,
                               RelativeSource={RelativeSource TemplatedParent}}"
                  AllowsColumnReorder="{Binding
                               Path=TemplatedParent.View.AllowsColumnReorder,
                               RelativeSource={RelativeSource TemplatedParent}}"
                  ColumnHeaderContextMenu="{Binding
                               Path=TemplatedParent.View.ColumnHeaderContextMenu,
                               RelativeSource={RelativeSource TemplatedParent}}"
                  ColumnHeaderToolTip="{Binding
                               Path=TemplatedParent.View.ColumnHeaderToolTip,
                               RelativeSource={RelativeSource TemplatedParent}}"
                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
              </ScrollViewer>

              <ScrollContentPresenter Name="PART_ScrollContentPresenter"
                KeyboardNavigation.DirectionalNavigation="Local"/>
            </DockPanel>

            <ScrollBar Name="PART_HorizontalScrollBar"
              Orientation="Horizontal"
              Grid.Row="1"
              Maximum="{TemplateBinding ScrollableWidth}"
              ViewportSize="{TemplateBinding ViewportWidth}"
              Value="{TemplateBinding HorizontalOffset}"
              Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>

            <ScrollBar Name="PART_VerticalScrollBar"
              Grid.Column="1"
              Maximum="{TemplateBinding ScrollableHeight}"
              ViewportSize="{TemplateBinding ViewportHeight}"
              Value="{TemplateBinding VerticalOffset}"
              Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>

          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
    

  <Style x:Key="{x:Type ListView}" TargetType="ListView">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListView">
          <Border Name="Border"
            BorderThickness="1"
            BorderBrush="{StaticResource SolidBorderBrush}"
            Background="{StaticResource WindowBackgroundBrush}">
            <ScrollViewer Style="{DynamicResource
                          {x:Static GridView.GridViewScrollViewerStyleKey}}">
              <ItemsPresenter />
            </ScrollViewer>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsGrouping"
                     Value="true">
              <Setter Property="ScrollViewer.CanContentScroll"
                      Value="false"/>
            </Trigger>
            <Trigger Property="IsEnabled"
                     Value="false">
              <Setter TargetName="Border"
                      Property="Background"
                      Value="{StaticResource DisabledBorderBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type ListViewItem}" TargetType="ListViewItem">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ListBoxItem">
          <Border 
            Name="Border"
            Padding="2"
            SnapsToDevicePixels="true"
            Background="Transparent">
            <GridViewRowPresenter
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="true">
              <Setter TargetName="Border"
                      Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" 
                      Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- Alternating ListView Items -->
  <Style x:Key="AltListViewItem" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
    <Setter Property="Background" Value="{StaticResource AlternatingItemBrush}" />
  </Style>
  
    <!-- Menu -->
  <Style x:Key="{x:Type Menu}" TargetType="Menu">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Menu">
          <Border 
            Background="{StaticResource LightBrush}"
            BorderBrush="{StaticResource NormalBorderBrush}"
            BorderThickness="1">
            <StackPanel ClipToBounds="True" Orientation="Horizontal" IsItemsHost="True"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- ContextMenu -->
  <Style TargetType="ContextMenu">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
    <Setter Property="HasDropShadow" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ContextMenu">
          <Border 
            Name="Border"
            Background="{StaticResource WindowBackgroundBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1" >
            <StackPanel IsItemsHost="True"
                        KeyboardNavigation.DirectionalNavigation="Cycle"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="HasDropShadow" Value="true">
              <Setter TargetName="Border" Property="Padding" Value="0,3,0,3"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- MenuItem -->
  <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}"
         TargetType="Separator">
    <Setter Property="Height" Value="1"/>
    <Setter Property="Margin" Value="0,4,0,4"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Separator">
          <Border BorderBrush="{StaticResource SolidBorderBrush}"
                  BorderThickness="1"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- TopLevelHeader -->
  <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}"
                   TargetType="MenuItem">
    <Border Name="Border" >
      <Grid>
        <ContentPresenter 
          Margin="6,3,6,3" 
          ContentSource="Header"
          RecognizesAccessKey="True" />
        <Popup 
          Name="Popup"
          Placement="Bottom"
          IsOpen="{TemplateBinding IsSubmenuOpen}"
          AllowsTransparency="True" 
          Focusable="False"
          PopupAnimation="Fade">
          <Border 
            Name="SubmenuBorder"
            SnapsToDevicePixels="True"
            Background="{StaticResource WindowBackgroundBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1" >
            <StackPanel  
              IsItemsHost="True" 
              KeyboardNavigation.DirectionalNavigation="Cycle" />
          </Border>
        </Popup>
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsSuspendingPopupAnimation" Value="true">
        <Setter TargetName="Popup" Property="PopupAnimation" Value="None"/>
      </Trigger>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter TargetName="Border" Property="Background"
                Value="{StaticResource NormalBrush}"/>
        <Setter TargetName="Border" Property="BorderBrush"
                Value="Transparent"/>
      </Trigger>
      <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
        <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,0,0,3"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  
  <!-- TopLevelItem -->
  <ControlTemplate 
    x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" 
    TargetType="MenuItem">
    <Border Name="Border" >
      <Grid>
        <ContentPresenter 
          Margin="6,3,6,3" 
          ContentSource="Header"
          RecognizesAccessKey="True" />
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter TargetName="Border" Property="Background"
                Value="{StaticResource NormalBrush}"/>
        <Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Foreground"
                Value="{StaticResource DisabledForegroundBrush}"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!-- SubmenuItem -->
  <ControlTemplate 
    x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" 
    TargetType="MenuItem">
    <Border Name="Border" >
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
          <ColumnDefinition Width="13"/>
        </Grid.ColumnDefinitions>
        <ContentPresenter 
          Name="Icon"
          Margin="6,0,6,0"
          VerticalAlignment="Center"
          ContentSource="Icon"/>
        <Border 
          Name="Check"  
          Width="13" Height="13" 
          Visibility="Collapsed"
          Margin="6,0,6,0" 
          Background="{StaticResource NormalBrush}"
          BorderThickness="1"
          BorderBrush="{StaticResource NormalBorderBrush}">
          <Path 
            Name="CheckMark"
            Width="7" Height="7" 
            Visibility="Hidden" 
            SnapsToDevicePixels="False" 
            Stroke="{StaticResource GlyphBrush}"
            StrokeThickness="2"
            Data="M 0 0 L 7 7 M 0 7 L 7 0" />
        </Border>
        <ContentPresenter 
          Name="HeaderHost"
          Grid.Column="1"
          ContentSource="Header"
          RecognizesAccessKey="True"/>
        <TextBlock x:Name="InputGestureText"
          Grid.Column="2"
          Text="{TemplateBinding InputGestureText}"
          Margin="5,2,0,2"
          DockPanel.Dock="Right" />
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="IsCheckable" Value="true">
        <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
        <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
      </Trigger>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter TargetName="Border" Property="Background"
                Value="{StaticResource SelectedBackgroundBrush}"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!-- SubmenuHeader -->
  <ControlTemplate 
    x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" 
    TargetType="MenuItem">
    <Border Name="Border" >
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
          <ColumnDefinition Width="13"/>
        </Grid.ColumnDefinitions>
        <ContentPresenter 
          Name="Icon"
          Margin="6,0,6,0"
          VerticalAlignment="Center"
          ContentSource="Icon"/>
        <ContentPresenter 
          Name="HeaderHost"
          Grid.Column="1"
          ContentSource="Header"
          RecognizesAccessKey="True"/>
        <TextBlock x:Name="InputGestureText"
          Grid.Column="2"
          Text="{TemplateBinding InputGestureText}"
          Margin="5,2,2,2"
          DockPanel.Dock="Right"/>
        <Path 
          Grid.Column="3"
          HorizontalAlignment="Center"
          VerticalAlignment="Center"
          Data="M 0 0 L 0 7 L 4 3.5 Z" 
          Fill="{StaticResource GlyphBrush}" />
        <Popup 
          Name="Popup"
          Placement="Right"
          HorizontalOffset="-4" 
          IsOpen="{TemplateBinding IsSubmenuOpen}"
          AllowsTransparency="True" 
          Focusable="False"
          PopupAnimation="Fade">
          <Border 
            Name="SubmenuBorder"
            SnapsToDevicePixels="True"
            Background="{StaticResource WindowBackgroundBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1" >
            <StackPanel  
              IsItemsHost="True" 
              KeyboardNavigation.DirectionalNavigation="Cycle" />
          </Border>
        </Popup>
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
      </Trigger>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter TargetName="Border" Property="Background"
                Value="{StaticResource SelectedBackgroundBrush}"/>
      </Trigger>
      <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
        <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,3,0,3"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!-- MenuItem Style -->
  <Style x:Key="{x:Type MenuItem}" TargetType="MenuItem">
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Style.Triggers>
      <Trigger Property="Role" Value="TopLevelHeader">
        <Setter Property="Template"
                Value="{StaticResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}"/>
        <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
      </Trigger>
      <Trigger Property="Role" Value="TopLevelItem">
        <Setter Property="Template"
                Value="{StaticResource {x:Static MenuItem.TopLevelItemTemplateKey}}"/>
      </Trigger>
      <Trigger Property="Role" Value="SubmenuHeader">
        <Setter Property="Template"
                Value="{StaticResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/>
      </Trigger>
      <Trigger Property="Role" Value="SubmenuItem">
        <Setter Property="Template"
                Value="{StaticResource {x:Static MenuItem.SubmenuItemTemplateKey}}"/>
      </Trigger>
    </Style.Triggers>
  </Style>

    <!-- Back/Forward Button Style -->
    <Style x:Key="NavWinButtonStyle" TargetType="Button">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Command" Value="NavigationCommands.BrowseBack"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Ellipse 
          Name="Ellipse" 
          Fill="{StaticResource NormalBrush}"
          Stroke="{StaticResource NormalBorderBrush}"
          StrokeThickness="1" 
          Width="24"
          Height="24"/>
  
                        <Path 
          x:Name="Arrow"
          Margin="0,0,3,0"
          Fill="{StaticResource GlyphBrush}"
          HorizontalAlignment="Center"
          VerticalAlignment="Center"
          Data="M 6 0 L 0 6 L 6 12 Z"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Command"
                 Value="{x:Static NavigationCommands.BrowseForward}">
                            <Setter TargetName="Arrow"
                  Property="Data" Value="M 0 0 L 6 6 L 0 12 z"/>
                            <Setter TargetName="Arrow"
                  Property="Margin" Value="3,0,0,0"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Ellipse"
                  Property="Fill" Value="{StaticResource DarkBrush}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Ellipse"
                  Property="Fill" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="Ellipse"
                  Property="Stroke" Value="{StaticResource PressedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Ellipse"
                  Property="Fill" Value="{StaticResource DisabledBackgroundBrush}"/>
                            <Setter TargetName="Arrow"
                  Property="Fill" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <!-- NavWin Menu Style -->
    <Style x:Key="NavWinMenu" TargetType="Menu">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="IsMainMenu" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Menu">
                    <DockPanel IsItemsHost="true"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <!-- NavWin Menu Header Style -->
    <Style x:Key="NavWinHeaderMenuItem" TargetType="MenuItem">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="MenuItem">
                    <Grid>
                        <Popup x:Name="PART_Popup"
          Placement="Bottom"
          VerticalOffset="2"
          IsOpen="{TemplateBinding IsSubmenuOpen}"
          AllowsTransparency="True" 
          Focusable="False"
          PopupAnimation="Fade">
                            <Border Name="SubMenuBorder"
            Background="{StaticResource WindowBackgroundBrush}"
            BorderThickness="1"
            BorderBrush="{StaticResource SolidBorderBrush}">
                                <StackPanel IsItemsHost="true"
              Margin="2"
              KeyboardNavigation.TabNavigation="Cycle"
              KeyboardNavigation.DirectionalNavigation="Cycle"/>
                            </Border>
                        </Popup>
  
                        <Grid x:Name="Panel" 
          Width="24" 
          Background="Transparent"
          HorizontalAlignment="Right" >
  
                            <Border Visibility="Hidden" 
            Name="HighlightBorder" 
            BorderThickness="1" 
            BorderBrush="{StaticResource NormalBorderBrush}" 
            Background="{StaticResource NormalBrush}" 
            CornerRadius="2" />
                            <Path x:Name="Arrow"
            SnapsToDevicePixels="false"
            HorizontalAlignment="Right"
            VerticalAlignment="Center"
            Margin="0,2,4,0"
            Fill="{StaticResource GlyphBrush}"
            StrokeLineJoin="Round"
            Data="M 0 0 L 4 4 L 8 0 Z"/>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter TargetName="HighlightBorder" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsSubmenuOpen" Value="true">
                            <Setter TargetName="HighlightBorder" Property="Background" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="HighlightBorder" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Arrow" Property="Fill"  Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- NavWin Menu Item Style -->
    <Style x:Key="NavWinSubmenuItem" TargetType="MenuItem">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Header" Value="{Binding Path=(JournalEntry.Name)}"/>
        <Setter Property="Command" Value="NavigationCommands.NavigateJournal"/>
        <Setter Property="CommandTarget"
        Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type Menu}},
        Path=TemplatedParent}"/>
        <Setter Property="CommandParameter"
        Value="{Binding RelativeSource={RelativeSource Self}}"/>
        <Setter Property="JournalEntryUnifiedViewConverter.JournalEntryPosition"
        Value="{Binding (JournalEntryUnifiedViewConverter.JournalEntryPosition)}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type MenuItem}">
                    <Grid Name="Panel"
        Background="Transparent"
        SnapsToDevicePixels="true">
                        <Path Name="Glyph"
          SnapsToDevicePixels="false"
          Margin="7,5"
          Width="10"
          Height="10"
          HorizontalAlignment="Left"
          StrokeStartLineCap="Triangle"
          StrokeEndLineCap="Triangle"
          StrokeThickness="2"
          Stroke="{StaticResource GlyphBrush}" />
  
                        <ContentPresenter ContentSource="Header"
          Margin="24,5,50,5"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Value="Current"
                 Property="JournalEntryUnifiedViewConverter.JournalEntryPosition" >
                            <Setter TargetName="Glyph" Property="Data"
                  Value="M 0,5 L 2.5,8 L 7,3 "/>
                        </Trigger>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter TargetName="Panel" Property="Background"
                  Value="{StaticResource SelectedBackgroundBrush}"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="MenuItem.IsHighlighted"
                       Value="true"/>
                                <Condition Value="Forward"
                       Property="JournalEntryUnifiedViewConverter.JournalEntryPosition" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="Glyph" Property="Data"
                  Value="M 3 1 L 7 5 L 3 9 z"/>
                            <Setter TargetName="Glyph" Property="Fill"
                  Value="{StaticResource GlyphBrush}"/>
                            <Setter TargetName="Glyph" Property="Stroke"
                  Value="{x:Null}"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="MenuItem.IsHighlighted"
                       Value="true"/>
                                <Condition Value="Back"
                       Property="JournalEntryUnifiedViewConverter.JournalEntryPosition"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="Glyph" Property="Data" Value="M 7 1 L 3 5 L 7 9 z"/>
                            <Setter TargetName="Glyph" Property="Fill" Value="{StaticResource GlyphBrush}"/>
                            <Setter TargetName="Glyph" Property="Stroke" Value="{x:Null}"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <!-- Merges Back and Forward Navigation Stacks -->
    <JournalEntryUnifiedViewConverter x:Key="JournalEntryUnifiedViewConverter"/>
    
    <BorderGapMaskConverter x:Key="BorderGapMaskConverter"/>
  
    <!-- SimpleStyles: NavigationWindow -->
    <Style x:Key="{x:Type NavigationWindow}" TargetType="NavigationWindow">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="NavigationWindow">
                    <DockPanel  Background="{StaticResource WindowBackgroundBrush}">
                        <Grid Background="{StaticResource LightBrush}"
          DockPanel.Dock="Top"
          Height="30">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="16"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
  
                            <Menu Name="NavMenu"
            Grid.ColumnSpan="3"
            Height="20"
            Margin="1,0,0,0"
            VerticalAlignment="Center" 
            Style="{StaticResource NavWinMenu}">
                                <MenuItem Style="{StaticResource NavWinHeaderMenuItem}"
              ItemContainerStyle="{StaticResource NavWinSubmenuItem}"
              IsSubmenuOpen="{Binding Path=(MenuItem.IsSubmenuOpen),
              Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}">
                                    <MenuItem.ItemsSource>
                                        <MultiBinding Converter="{StaticResource JournalEntryUnifiedViewConverter}">
                                            <MultiBinding.Bindings>
                                                <Binding RelativeSource="{RelativeSource TemplatedParent}" 
                      Path="BackStack" />
                                                <Binding RelativeSource="{RelativeSource TemplatedParent}" 
                      Path="ForwardStack" />
                                            </MultiBinding.Bindings>
                                        </MultiBinding>
                                    </MenuItem.ItemsSource>
                                </MenuItem>
                            </Menu>
  
                            <Path Grid.Column="0" 
            SnapsToDevicePixels="false"
            IsHitTestVisible="false"
            Margin="2,0,0,0"
            Grid.ColumnSpan="3"
            StrokeThickness="1" 
            HorizontalAlignment="Left" 
            VerticalAlignment="Center" 
            Data="M22.5767,21.035 Q27,19.37 31.424,21.035 A12.5,12.5,0,0,0,53.5,13 A12.5,12.5,0,0,0,37.765,0.926 Q27,4.93 16.235,0.926 A12.5,12.5,0,0,0,0.5,13 A12.5,12.5,0,0,0,22.5767,21.035 z"
            Fill="{StaticResource PressedBrush}"
            Stroke="{StaticResource LightBorderBrush}"/>
                            <Button Style="{StaticResource NavWinButtonStyle}"
            Command="NavigationCommands.BrowseBack"
            Content="M 4 0 L 0 4 L 4 8 Z"
            Margin="3,0,2,0" 
            Grid.Column="0"/>
                            <Button Style="{StaticResource NavWinButtonStyle}"
            Command="NavigationCommands.BrowseForward"
            Content="M 4 0 L 0 4 L 4 8 Z"
            Margin="2,0,0,0" 
            Grid.Column="1"/>
                        </Grid>
                        <Grid>
                            <AdornerDecorator>
                                <ContentPresenter Name="PART_NavWinCP" 
                              ClipToBounds="true"/>
                            </AdornerDecorator>
  
                            <ResizeGrip x:Name="WindowResizeGrip"
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            Visibility="Collapsed" 
            IsTabStop="false"/>
                        </Grid>
                    </DockPanel>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="CanGoForward" Value="false"/>
                                <Condition Property="CanGoBack" Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="NavMenu" Property="IsEnabled" Value="false"/>
                        </MultiTrigger>
                        <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
                            <Setter TargetName="WindowResizeGrip" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <!-- ProgressBar -->
    <Style x:Key="{x:Type ProgressBar}"
   TargetType="{x:Type ProgressBar}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid MinHeight="14" MinWidth="200">
                        <Border 
          Name="PART_Track" 
          CornerRadius="2" 
          Background="{StaticResource PressedBrush}"
          BorderBrush="{StaticResource SolidBorderBrush}"
          BorderThickness="1" />
                        <Border 
          Name="PART_Indicator" 
          CornerRadius="2" 
          Background="{StaticResource DarkBrush}" 
          BorderBrush="{StaticResource NormalBorderBrush}" 
          BorderThickness="1" 
          HorizontalAlignment="Left" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- Focus Visual -->
    <Style x:Key="RadioButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle 
          Margin="15,0,0,0"
          StrokeThickness="1"
          Stroke="#60000000"
          StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- SimpleStyles: RadioButton -->
    <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle"	Value="{StaticResource RadioButtonFocusVisual}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Grid Width="13" 
            Height="13" >
                                <Ellipse x:Name="Border"  
              Fill="{StaticResource NormalBrush}"
              StrokeThickness="1"
              Stroke="{StaticResource NormalBorderBrush}" />
                                <Ellipse x:Name="CheckMark"
              Margin="4"
              Fill="{StaticResource GlyphBrush}" />
                            </Grid>
                        </BulletDecorator.Bullet>
                        <ContentPresenter 
          Margin="4,0,0,0"
          VerticalAlignment="Center"
          HorizontalAlignment="Left"
          RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{StaticResource GlyphBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="Stroke" Value="#40000000" />
                            <Setter Property="Foreground" Value="#80000000"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border 
        Name="Border"
        Margin="1" 
        CornerRadius="1" 
        Background="{StaticResource NormalBrush}"
        BorderBrush="{StaticResource NormalBorderBrush}"
        BorderThickness="1">
                        <Path 
          HorizontalAlignment="Center"
          VerticalAlignment="Center"
          Fill="{StaticResource GlyphBrush}"
          Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
      
    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border 
        CornerRadius="1" 
        Background="{TemplateBinding Background}"
        BorderBrush="{TemplateBinding BorderBrush}"
        BorderThickness="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    
    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="18"/>
            </Grid.ColumnDefinitions>
            <Border
    Grid.ColumnSpan="3"
    CornerRadius="1" 
    Background="#F0F0F0" />
            <RepeatButton 
    Grid.Column="0"                           
    Style="{StaticResource ScrollBarLineButton}"
    Width="18"
    Command="ScrollBar.LineLeftCommand"
    Content="M 4 0 L 4 8 L 0 4 Z" />
            <Track 
    Name="PART_Track"
    Grid.Column="1"
    IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
        Style="{StaticResource ScrollBarPageButton}"
        Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
        Style="{StaticResource ScrollBarThumb}" 
        Margin="0,1,0,1"  
        Background="{StaticResource NormalBrush}"
        BorderBrush="{StaticResource NormalBorderBrush}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
        Style="{StaticResource ScrollBarPageButton}"
        Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
    Grid.Column="3" 
    Style="{StaticResource ScrollBarLineButton}"
    Width="18"
    Command="ScrollBar.LineRightCommand"
    Content="M 0 0 L 4 4 L 0 8 Z"/>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18"/>
                <RowDefinition Height="0.00001*"/>
                <RowDefinition MaxHeight="18"/>
            </Grid.RowDefinitions>
            <Border
    Grid.RowSpan="3"
    CornerRadius="1" 
    Background="#F0F0F0" />
            <RepeatButton 
    Grid.Row="0"                           
    Style="{StaticResource ScrollBarLineButton}"
    Height="18"
    Command="ScrollBar.LineUpCommand"
    Content="M 0 4 L 8 4 L 4 0 Z" />
            <Track 
    Name="PART_Track"
    Grid.Row="1"
    IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
        Style="{StaticResource ScrollBarPageButton}"
        Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
        Style="{StaticResource ScrollBarThumb}" 
        Margin="1,0,1,0"  
        Background="{StaticResource HorizontalNormalBrush}"
        BorderBrush="{StaticResource HorizontalNormalBorderBrush}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
        Style="{StaticResource ScrollBarPageButton}"
        Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
    Grid.Row="3" 
    Style="{StaticResource ScrollBarLineButton}"
    Height="18"
    Command="ScrollBar.LineDownCommand"
    Content="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
    </ControlTemplate>
    
    <!-- Scrollbar -->
    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="18" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <!-- ResizeGrip -->
    <Style x:Key="{x:Type ResizeGrip}" TargetType="{x:Type ResizeGrip}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ResizeGrip}">
                    <Border Background="Transparent"
        SnapsToDevicePixels="True"
        Width="16"
        Height="16">
                        <Rectangle Margin="2">
                            <Rectangle.Fill>
                                <DrawingBrush Viewport="0,0,4,4" 
              ViewportUnits="Absolute"
              Viewbox="0,0,8,8"
              ViewboxUnits="Absolute"
              TileMode="Tile">
                                    <DrawingBrush.Drawing>
                                        <DrawingGroup>
                                            <DrawingGroup.Children>
                                                <GeometryDrawing Brush="#AAA"
                      Geometry="M 4 4 L 4 8 L 8 8 L 8 4 z"/>
                                            </DrawingGroup.Children>
                                        </DrawingGroup>
                                    </DrawingBrush.Drawing>
                                </DrawingBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

        <!-- ScrollViewer -->
        <Style x:Key="LeftScrollViewer" TargetType="{x:Type ScrollViewer}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollViewer}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <ScrollContentPresenter Grid.Column="1"/>

                            <ScrollBar Name="PART_VerticalScrollBar"
              Value="{TemplateBinding VerticalOffset}"
              Maximum="{TemplateBinding ScrollableHeight}"
              ViewportSize="{TemplateBinding ViewportHeight}"
              Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                            <ScrollBar Name="PART_HorizontalScrollBar"
              Orientation="Horizontal"
              Grid.Row="1"
              Grid.Column="1"
              Value="{TemplateBinding HorizontalOffset}"
              Maximum="{TemplateBinding ScrollableWidth}"
              ViewportSize="{TemplateBinding ViewportWidth}"
              Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!-- Separator  -->
        <Style TargetType="{x:Type Separator}">
            <Setter Property="Height" Value="1" />
            <Setter Property="Margin" Value="0,2,0,2" />
            <Setter Property="Focusable" Value="false" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Separator}">
                        <Border BorderBrush="{StaticResource SolidBorderColor}" BorderThickness="1" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- TextBox -->
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Margin" Value="2" />
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="false"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="MinWidth" Value="80"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border 
              Name="Border"
              CornerRadius="1" 
              Padding="2"
              Background="{StaticResource WindowBackgroundBrush}"
              BorderBrush="{StaticResource SolidBorderBrush}"
              BorderThickness="1" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost" Background="{TemplateBinding Background}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip" 
                      Value="{Binding RelativeSource={RelativeSource Self},Path=(Validation.Errors)[0].ErrorContent}" />
                    <Setter Property="Padding" Value="0,0,18,0" />
                    <Setter Property="Background">
                        <Setter.Value>
                            <ImageBrush ImageSource="pack://application:,,,/images/error_16.png" Stretch="None" AlignmentX="Right" AlignmentY="Center" />
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- RichTextBox -->
        <Style x:Key="{x:Type RichTextBox}"
         BasedOn="{StaticResource {x:Type TextBox}}"
         TargetType="{x:Type RichTextBox}">
            <Style.Resources>
                <Style x:Key="{x:Type FlowDocument}"
             TargetType="{x:Type FlowDocument}">
                    <Setter Property="OverridesDefaultStyle"
              Value="true"/>
                </Style>
            </Style.Resources>
        </Style>

        <!-- PasswordBox -->
        <Style x:Key="{x:Type PasswordBox}" TargetType="{x:Type PasswordBox}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="FontFamily" Value="Verdana"/>
            <Setter Property="PasswordChar" Value="?"/>
            <Setter Property="MinWidth" Value="120"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type PasswordBox}">
                        <Border 
              Name="Border"
              CornerRadius="1" 
              Padding="2" 
              Background="{StaticResource WindowBackgroundBrush}"
              BorderBrush="{StaticResource SolidBorderBrush}"
              BorderThickness="1" >
                            <ScrollViewer x:Name="PART_ContentHost" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!-- SimpleStyles: ToolBar -->
        <Style x:Key="ToolBarButtonBaseStyle" TargetType="{x:Type ButtonBase}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ButtonBase}">
                        <Border 
              x:Name="Border"  
              BorderThickness="1"
              Background="Transparent"
              BorderBrush="Transparent">
                            <ContentPresenter 
                Margin="2"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SolidBorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SolidBorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                            </Trigger>
                            <Trigger Property="CheckBox.IsChecked" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Static ToolBar.ButtonStyleKey}" 
           BasedOn="{StaticResource ToolBarButtonBaseStyle}"
           TargetType="{x:Type Button}"/>
        <Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" 
           BasedOn="{StaticResource ToolBarButtonBaseStyle}"
           TargetType="{x:Type ToggleButton}"/>
        <Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" 
           BasedOn="{StaticResource ToolBarButtonBaseStyle}"
           TargetType="{x:Type CheckBox}"/>
        <Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}"
           BasedOn="{StaticResource ToolBarButtonBaseStyle}"
           TargetType="{x:Type RadioButton}"/>

        <Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                        <Border 
              Name="Border"
              Padding="2"
              Background="{StaticResource WindowBackgroundBrush}"
              BorderBrush="{StaticResource SolidBorderBrush}"
              BorderThickness="1" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type ToolBar}" TargetType="{x:Type ToolBar}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToolBar}">
                        <Border x:Name="Border" BorderThickness="1,0,1,1"
                    Background="{StaticResource LightBrush}" BorderBrush="{StaticResource NormalBorderBrush}">
                            <DockPanel >
                                <ToolBarPanel x:Name="PART_ToolBarPanel"
                                          IsItemsHost="true" Margin="0,1,2,2"/>
                            </DockPanel>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type ToolBarTray}" TargetType="{x:Type ToolBarTray}" >
            <Setter Property="Background" Value="{StaticResource HorizontalLightBrush}"/>
        </Style>

        <!-- ToolTip -->
        <Style x:Key="{x:Type ToolTip}" TargetType="ToolTip">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="HasDropShadow" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToolTip">
                        <Border Name="Border"
            Background="{StaticResource LightBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1"
            Width="{TemplateBinding Width}"
            Height="{TemplateBinding Height}">
                            <ContentPresenter
              Margin="4" 
              HorizontalAlignment="Left"
              VerticalAlignment="Top" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasDropShadow" Value="true">
                                <Setter TargetName="Border" Property="CornerRadius" Value="0"/>
                                <Setter TargetName="Border" Property="SnapsToDevicePixels" Value="true"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- TreeView -->
        <Style x:Key="{x:Type TreeView}" TargetType="TreeView">
            <Setter Property="OverridesDefaultStyle" Value="True" />
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TreeView">
                        <Border 
            Name="Border" 
            CornerRadius="1" 
            Background="#d9d9d9"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}" >
                            <ScrollViewer 
              Focusable="False"
              CanContentScroll="False"
              Padding="0">
                                <ItemsPresenter/>
                            </ScrollViewer>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- TreeViewItem -->
        <Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton">
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid
            Width="15"
            Height="13"
            Background="Transparent">
                            <Path x:Name="ExpandPath"
              HorizontalAlignment="Left" 
              VerticalAlignment="Center" 
              Margin="1,1,1,1"
              Fill="{StaticResource GlyphBrush}"
              Data="M 4 0 L 8 4 L 4 8 Z"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked"
                 Value="True">
                                <Setter Property="Data"
                  TargetName="ExpandPath"
                  Value="M 0 4 L 8 4 L 4 8 Z"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="TreeViewItemFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle Margin="0,0,0,0"
                   StrokeThickness="5"
                   Stroke="Black"
                   StrokeDashArray="1 2"
                   Opacity="0"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type TreeViewItem}"
       TargetType="{x:Type TreeViewItem}">
            <Setter Property="Background"
        Value="Transparent"/>
            <Setter Property="HorizontalContentAlignment"
        Value="{Binding Path=HorizontalContentAlignment,
                RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="VerticalContentAlignment"
        Value="{Binding Path=VerticalContentAlignment,
                RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
            <Setter Property="Padding"
        Value="1,0,0,0"/>
            <Setter Property="Foreground"
        Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="FocusVisualStyle"
        Value="{StaticResource TreeViewItemFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TreeViewItem}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition MinWidth="19"
                        Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Border Margin="-2000,0,0,0" x:Name="bgBorder"
                Grid.Column="0" Grid.ColumnSpan="3" Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}" IsHitTestVisible="False"
                BorderThickness="{TemplateBinding BorderThickness}"
                Padding="8" />
                            <ToggleButton x:Name="Expander"
                    Style="{StaticResource ExpandCollapseToggleStyle}"
                    IsChecked="{Binding Path=IsExpanded,
                                RelativeSource={RelativeSource TemplatedParent}}"
                    ClickMode="Press"/>
                            <Border Name="Bd"
                Grid.Column="1"
                Background="{TemplateBinding Background}"
                Padding="{TemplateBinding Padding}">
                                <ContentPresenter x:Name="PART_Header"
                        ContentSource="Header"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                            </Border>
                            <ItemsPresenter x:Name="ItemsHost"
                    Grid.Row="1"
                    Grid.Column="1"
                    Grid.ColumnSpan="2"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsExpanded"
                 Value="false">
                                <Setter TargetName="ItemsHost"
                  Property="Visibility"
                  Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="HasItems"
                 Value="false">
                                <Setter TargetName="Expander"
                  Property="Visibility"
                  Value="Hidden"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="HasHeader"
                       Value="false"/>
                                    <Condition Property="Width"
                       Value="Auto"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="PART_Header"
                  Property="MinWidth"
                  Value="75"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="HasHeader"
                       Value="false"/>
                                    <Condition Property="Height"
                       Value="Auto"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="PART_Header"
                  Property="MinHeight"
                  Value="19"/>
                            </MultiTrigger>
                            <Trigger Property="IsSelected"
                 Value="true">
                                <Setter TargetName="Bd"
                  Property="Background"
                  Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                                <Setter Property="Foreground"
                  Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsTextSearchEnabled" Value="true">
                                <Setter TargetName="bgBorder"
                  Property="IsHitTestVisible"
                  Value="true"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected"
                       Value="true"/>
                                    <Condition Property="IsSelectionActive"
                       Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="Bd"
                  Property="Background"
                  Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                                <Setter Property="Foreground"
                  Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            </MultiTrigger>
                            <Trigger Property="IsEnabled"
                 Value="false">
                                <Setter Property="Foreground"
                  Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- SimpleStyles: CheckBox -->
        <Style x:Key="CheckBoxFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
              Margin="15,0,0,0"
              StrokeThickness="1"
              Stroke="#60000000"
              StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle"	Value="{StaticResource CheckBoxFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Border x:Name="Border"  
                Width="13" 
                Height="13" 
                CornerRadius="0" 
                Background="{StaticResource NormalBrush}"
                BorderThickness="1"
                BorderBrush="{StaticResource NormalBorderBrush}">
                                    <Path 
                  Width="7" Height="7" 
                  x:Name="CheckMark"
                  SnapsToDevicePixels="False" 
                  Stroke="{StaticResource GlyphBrush}"
                  StrokeThickness="2"
                  Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                                </Border>
                            </BulletDecorator.Bullet>
                            <ContentPresenter Margin="4,0,0,0"
              VerticalAlignment="Center"
              HorizontalAlignment="Left"
              RecognizesAccessKey="True"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="{x:Null}">
                                <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ComboBox -->
        <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="20" />
                </Grid.ColumnDefinitions>
                <Border
        x:Name="Border" 
        Grid.ColumnSpan="2"
        CornerRadius="1"
        Background="{StaticResource NormalBrush}"
        BorderBrush="{StaticResource SolidBorderBrush}"
        BorderThickness="1" />
                <Border 
        Grid.Column="0"
        CornerRadius="1,0,0,1" 
        Margin="1" 
        Background="{StaticResource WindowBackgroundBrush}" 
        BorderBrush="{StaticResource NormalBorderBrush}"
        BorderThickness="0,0,1,0" />
                <Path 
        x:Name="Arrow"
        Grid.Column="1"     
        Stroke="{StaticResource GlyphBrush}"
        StrokeThickness="2" 
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 1 1 L 4 4 7 1"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DarkBrush}" />
                </Trigger>
                <Trigger Property="ToggleButton.IsChecked" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                    <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
            <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
        </ControlTemplate>

        <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
            <Setter Property="Margin" Value="2" />
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="MinWidth" Value="120"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid>
                            <ToggleButton 
              Name="ToggleButton" 
              Template="{StaticResource ComboBoxToggleButton}" 
              Grid.Column="2" 
              Focusable="false"
              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
              ClickMode="Press">
                            </ToggleButton>
                            <ContentPresenter
              Name="ContentSite"
              IsHitTestVisible="False" 
              Content="{TemplateBinding SelectionBoxItem}"
              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
              Margin="3,1,23,1"
              VerticalAlignment="Center"
              HorizontalAlignment="Left" />
                            <TextBox x:Name="PART_EditableTextBox"
              Style="{x:Null}" 
              Template="{StaticResource ComboBoxTextBox}" 
              HorizontalAlignment="Left" 
              VerticalAlignment="Center" 
              Margin="3,3,23,3"
              Focusable="True" 
              Background="Transparent"
              Visibility="Hidden"
              IsReadOnly="{TemplateBinding IsReadOnly}"/>
                            <Popup 
              Name="Popup"
              Placement="Bottom"
              IsOpen="{TemplateBinding IsDropDownOpen}"
              AllowsTransparency="True" 
              Focusable="False"
              PopupAnimation="Slide">
                                <Grid 
                Name="DropDown"
                SnapsToDevicePixels="True"                
                MinWidth="{TemplateBinding ActualWidth}"
                MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                    <Border 
                  x:Name="DropDownBorder"
                  Background="{StaticResource WindowBackgroundBrush}"
                  BorderThickness="1"
                  BorderBrush="{StaticResource SolidBorderBrush}"/>
                                    <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
                                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                    </ScrollViewer>
                                </Grid>
                            </Popup>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasItems" Value="false">
                                <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                                <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="2"/>
                                <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEditable"
                 Value="true">
                                <Setter Property="IsTabStop" Value="false"/>
                                <Setter TargetName="PART_EditableTextBox" Property="Visibility"	Value="Visible"/>
                                <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
            </Style.Triggers>
        </Style>

        <!-- ComboBoxItem -->
        <Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Border 
            Name="Border"
            Padding="1"
            SnapsToDevicePixels="true">
                            <ContentPresenter />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Expander button  -->
        <Style x:Key="GroupBoxExpanderToggleButtonStyle" TargetType="{x:Type ToggleButton}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Grid SnapsToDevicePixels="False" Background="Transparent">
                            <Ellipse HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="15" Height="15" Fill="{DynamicResource ButtonNormalBackgroundFill}" Stroke="DarkGray"/>
                            <Ellipse Visibility="Hidden" HorizontalAlignment="Center" x:Name="shadow" VerticalAlignment="Center" Width="13" Height="13" Fill="{DynamicResource ExpanderShadowFill}"/>
                            <Path SnapsToDevicePixels="false" x:Name="arrow" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="#666" StrokeThickness="2" Data="M1,1 L4,4 7,1" />
                        </Grid>

                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="true">
                                <Setter Property="Data" TargetName="arrow" Value="M 1,4  L 4,1  L 7,4"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Stroke" TargetName="circle" Value="#666"/>
                                <Setter Property="Stroke" TargetName="arrow" Value="#222"/>
                                <Setter Property="Visibility" TargetName="shadow" Value="Visible"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <SolidColorBrush x:Key="GroupBoxBorderBrush" Color="#D0D0BF"/>
        <SolidColorBrush x:Key="GroupBoxHeaderBrush" Color="#0046D5"/>

        <!--  -->
        <Style TargetType="Expander">
            <Setter Property="BorderBrush" Value="{StaticResource GroupBoxBorderBrush}" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Margin" Value="0,0,0,5" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Expander}">
                        <Grid SnapsToDevicePixels="true">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="6" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="6" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="6" />
                            </Grid.RowDefinitions>
                            <Border CornerRadius="4" Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="4" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Transparent" Background="{TemplateBinding Background}" />
                            <Border x:Name="Header" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Padding="3,0,3,0">
                                <Grid SnapsToDevicePixels="False" Background="Transparent" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <ToggleButton Grid.Column="0" MinHeight="0" MinWidth="0"
                                    Name="HeaderToggle" Style="{StaticResource GroupBoxExpanderToggleButtonStyle}"
                                    IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" >
                                    </ToggleButton>
                                    <ContentPresenter ContentSource="Header" RecognizesAccessKey="true"
                                    
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3,0,0,0" />
                                </Grid>
                            </Border>

                            <ContentPresenter x:Name="ExpandSite" Visibility="Collapsed" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

                            <Border Grid.Row="1" Grid.RowSpan="3" Grid.ColumnSpan="4" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4">
                                <Border.OpacityMask>
                                    <MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
                                        <Binding Path="ActualWidth" ElementName="Header"/>
                                        <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
                                        <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
                                    </MultiBinding>
                                </Border.OpacityMask>
                            </Border>

                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsExpanded" Value="true">
                                <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>

                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Back/Forward Button Style -->
        <Style x:Key="FrameButtonStyle" TargetType="Button">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Command" Value="NavigationCommands.BrowseBack"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <Ellipse 
              Name="Ellipse" 
              Fill="{StaticResource NormalBrush}"
              Stroke="{StaticResource NormalBorderBrush}"
              StrokeThickness="1" 
              Width="16"
              Height="16"/>

                            <Path 
              x:Name="Arrow"
              Margin="0,0,2,0"
              Fill="{StaticResource GlyphBrush}"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              Data="M 4 0 L 0 4 L 4 8 Z"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Command"
                     Value="{x:Static NavigationCommands.BrowseForward}">
                                <Setter TargetName="Arrow" Property="Data"
                      Value="M 0 0 L 4 4 L 0 8 z"/>
                                <Setter TargetName="Arrow" Property="Margin" Value="2,0,0,0"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Ellipse" Property="Fill"
                      Value="{StaticResource DarkBrush}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Ellipse" Property="Fill"
                      Value="{StaticResource PressedBrush}" />
                                <Setter TargetName="Ellipse" Property="Stroke"
                      Value="{StaticResource PressedBorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Ellipse" Property="Fill"
                      Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Arrow" Property="Fill"
                      Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Frame Menu Style -->
        <Style x:Key="FrameMenu" TargetType="Menu">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="IsMainMenu" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Menu">
                        <DockPanel IsItemsHost="true"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Frame Menu Header Style -->
        <Style x:Key="FrameHeaderMenuItem" TargetType="MenuItem">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="MenuItem">
                        <Grid>
                            <Popup x:Name="PART_Popup"
              Placement="Bottom"
              VerticalOffset="2"
              IsOpen="{TemplateBinding IsSubmenuOpen}"
              AllowsTransparency="True" 
              Focusable="False"
              PopupAnimation="Fade">
                                <Border Name="SubMenuBorder"
                Background="{StaticResource WindowBackgroundBrush}"
                BorderThickness="1"
                BorderBrush="{StaticResource SolidBorderBrush}">
                                    <StackPanel IsItemsHost="true"
                  Margin="2"
                  KeyboardNavigation.TabNavigation="Cycle"
                  KeyboardNavigation.DirectionalNavigation="Cycle"/>
                                </Border>
                            </Popup>

                            <Grid x:Name="Panel" 
              Width="24" 
              Background="Transparent"
              HorizontalAlignment="Right" >

                                <Border Visibility="Hidden" 
                Name="HighlightBorder" 
                BorderThickness="1" 
                BorderBrush="{StaticResource NormalBorderBrush}" 
                Background="{StaticResource NormalBrush}" 
                CornerRadius="2" />
                                <Path x:Name="Arrow"
                SnapsToDevicePixels="false"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Margin="0,2,4,0"
                Fill="{StaticResource GlyphBrush}"
                StrokeLineJoin="Round"
                Data="M 0 0 L 4 4 L 8 0 Z"/>
                            </Grid>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="true">
                                <Setter TargetName="HighlightBorder"
                      Property="Visibility" Value="Visible"/>
                            </Trigger>
                            <Trigger Property="IsSubmenuOpen" Value="true">
                                <Setter TargetName="HighlightBorder"
                      Property="Background" Value="{StaticResource PressedBrush}" />
                                <Setter TargetName="HighlightBorder"
                      Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Arrow"
                      Property="Fill"  Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Frame Menu Item Style -->
        <Style x:Key="FrameSubmenuItem" TargetType="MenuItem">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Header" Value="{Binding Path=(JournalEntry.Name)}"/>
            <Setter Property="Command" Value="NavigationCommands.NavigateJournal"/>
            <Setter Property="CommandTarget"
            Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type Menu}},
                            Path=TemplatedParent}"/>
            <Setter Property="CommandParameter"
            Value="{Binding RelativeSource={RelativeSource Self}}"/>
            <Setter Property="JournalEntryUnifiedViewConverter.JournalEntryPosition"
            Value="{Binding (JournalEntryUnifiedViewConverter.JournalEntryPosition)}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="MenuItem">
                        <Grid Name="Panel"
            Background="Transparent"
            SnapsToDevicePixels="true">
                            <Path Name="Glyph"
              SnapsToDevicePixels="false"
              Margin="7,5"
              Width="10"
              Height="10"
              HorizontalAlignment="Left"
              StrokeStartLineCap="Triangle"
              StrokeEndLineCap="Triangle"
              StrokeThickness="2"
              Stroke="{StaticResource GlyphBrush}" />

                            <ContentPresenter ContentSource="Header"
              Margin="24,5,50,5"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="JournalEntryUnifiedViewConverter.JournalEntryPosition"
                     Value="Current">
                                <Setter TargetName="Glyph"
                      Property="Data" Value="M 0,5 L 2.5,8 L 7,3 "/>
                            </Trigger>
                            <Trigger Property="IsHighlighted" Value="true">
                                <Setter TargetName="Panel" Property="Background"
                      Value="{StaticResource SelectedBackgroundBrush}"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="MenuItem.IsHighlighted" Value="true"/>
                                    <Condition Property="JournalEntryUnifiedViewConverter.JournalEntryPosition"
                           Value="Forward"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="Glyph" Property="Data" Value="M 3 1 L 7 5 L 3 9 z"/>
                                <Setter TargetName="Glyph" Property="Fill" Value="{StaticResource GlyphBrush}"/>
                                <Setter TargetName="Glyph" Property="Stroke" Value="{x:Null}"/>
                            </MultiTrigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="MenuItem.IsHighlighted" Value="true"/>
                                    <Condition Property="JournalEntryUnifiedViewConverter.JournalEntryPosition"
                           Value="Back"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="Glyph" Property="Data" Value="M 7 1 L 3 5 L 7 9 z"/>
                                <Setter TargetName="Glyph" Property="Fill" Value="{StaticResource GlyphBrush}"/>
                                <Setter TargetName="Glyph" Property="Stroke" Value="{x:Null}"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Frame -->
        <Style x:Key="{x:Type Frame}" TargetType="Frame">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Frame">
                        <DockPanel>
                            <Grid Background="{StaticResource LightBrush}"
              DockPanel.Dock="Top"
              Height="22">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="16"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <Menu Name="NavMenu"
                Grid.ColumnSpan="3"
                Height="16"
                Margin="1,0,0,0"
                VerticalAlignment="Center" 
                Style="{StaticResource FrameMenu}">
                                    <MenuItem Style="{StaticResource FrameHeaderMenuItem}"
                  ItemContainerStyle="{StaticResource FrameSubmenuItem}"
                  IsSubmenuOpen="{Binding Path=(MenuItem.IsSubmenuOpen),Mode=TwoWay,
                                  RelativeSource={RelativeSource TemplatedParent}}">
                                        <MenuItem.ItemsSource>
                                            <MultiBinding Converter="{StaticResource JournalEntryUnifiedViewConverter}">
                                                <MultiBinding.Bindings>
                                                    <Binding RelativeSource="{RelativeSource TemplatedParent}" 
                          Path="BackStack" />
                                                    <Binding RelativeSource="{RelativeSource TemplatedParent}" 
                          Path="ForwardStack" />
                                                </MultiBinding.Bindings>
                                            </MultiBinding>
                                        </MenuItem.ItemsSource>
                                    </MenuItem>
                                </Menu>

                                <Path Grid.Column="0" 
                SnapsToDevicePixels="false"
                IsHitTestVisible="false"
                Margin="2,0,0,0"
                Grid.ColumnSpan="3"
                StrokeThickness="1" 
                HorizontalAlignment="Left" 
                VerticalAlignment="Center" 
                Data="M15,14 Q18,12.9 20.9,14 A8.3,8.3,0,0,0,35.7,8.7 A8.3,8.3,0,0,0,25.2,0.6 Q18,
                      3.3 10.8,0.6 A8.3,8.3,0,0,0,0.3,8.7 A8.3,8.3,0,0,0,15,14 z"
                Fill="{StaticResource PressedBrush}"
                Stroke="{StaticResource LightBorderBrush}"/>
                                <Button Style="{StaticResource FrameButtonStyle}"
                Command="NavigationCommands.BrowseBack"
                Content="M 4 0 L 0 4 L 4 8 Z"
                Margin="2.7,0,1.3,0" 
                Grid.Column="0"/>
                                <Button Style="{StaticResource FrameButtonStyle}"
                Command="NavigationCommands.BrowseForward"
                Content="M 4 0 L 0 4 L 4 8 Z"
                Margin="1.3,0,0,0" 
                Grid.Column="1"/>
                            </Grid>
                            <ContentPresenter x:Name="PART_FrameCP"/>
                        </DockPanel>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="CanGoForward" Value="false"/>
                                    <Condition Property="CanGoBack" Value="false"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="NavMenu" Property="IsEnabled" Value="false"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <Style TargetType="{x:Type GroupBox}">
            <Setter Property="BorderBrush" Value="{StaticResource SolidBorderBrush}"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupBox}">
                        <Grid SnapsToDevicePixels="true">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="6"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="6"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="6"/>
                            </Grid.RowDefinitions>
                            <Border Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4"/>
                            <Border x:Name="Header" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Padding="3,1,3,0">
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
                            </Border>
                            <ContentPresenter Margin="2,5,2,5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2"/>
                            <Border Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4">
                                <Border.OpacityMask>
                                    <MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
                                        <Binding Path="ActualWidth" ElementName="Header"/>
                                        <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
                                        <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
                                    </MultiBinding>
                                </Border.OpacityMask>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
                                    <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
                                </Border>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type Window}" TargetType="Window">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Window}">
                        <Grid Background="{StaticResource WindowGradientBackgroundBrush}">
                            <AdornerDecorator>
                                <ContentPresenter/>
                            </AdornerDecorator>
                            <ResizeGrip x:Name="WindowResizeGrip"
              HorizontalAlignment="Right"
              VerticalAlignment="Bottom"
              Visibility="Collapsed" 
              IsTabStop="false"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
                                <Setter TargetName="WindowResizeGrip" Property="Visibility" Value="Visible"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
    <!-- Data Templates -->
    <DataTemplate DataType="{x:Type loc:RBApplication}">
        <TextBlock Text="{Binding DisplayName}" />
    </DataTemplate>
    <DataTemplate x:Key="DictionaryList">
        <TextBlock Text="{Binding Value}" />
    </DataTemplate>

    </ResourceDictionary>